#!/usr/bin/python
# -*- coding: utf-8 -*-
# @name             : 定位元素
# @author           : OneYoung
# @create           : 2024-02-05
# @version          : v1.0
# @desc             : 页面定位元素封装类,通过By方法获取定位信息

from selenium.webdriver.common.by import By


class PageLocators:
    """页面定位元素集"""
    # 用户名
    loc_username = (By.CSS_SELECTOR, '[placeholder="请输入手机号"]')
    # 密码
    loc_password = (By.XPATH, '//div/input[@placeholder="请输入密码"]')
    # 登录按钮
    loc_login_btn = (By.XPATH, '//form/div/div[5]/div/div/div[1]/button')
    # 用户名为空提示
    loc_name_empty_text = (By.XPATH, '//form/div/div[2]/div/div/div[2][@class="el-form-item__error"]')
    # 密码为空提示
    loc_pwd_empty_text = (By.XPATH, '//form/div/div[3]/div/div/div[2][@class="el-form-item__error"]')
    # 登录失败提示内容
    loc_fail_hint = (By.CLASS_NAME, 'el-message__content')
    # 登录成功标识
    loc_success_mark = (By.XPATH, '//section/div[2]/div/div[1]/div/div[1]/div[1]/div[2]/div[5]/div/span')
    # 个人中心
    loc_user_avatar = (By.XPATH, '//section/div[2]/div/div[1]/div/div[1]/div[1]/div[2]/div[5]/div')
    # 退出登录
    loc_logout = (By.XPATH, '//div[text()="退出系统"]')
    # 退出登录确认
    loc_logout_confirm = (By.CSS_SELECTOR, '.el-message-box__btns>button:nth-child(2')
